PrinterInterface

Superclass:
NSObject
Declared In:

Introduction

打印机接口的基类 The base class of the printer interface



Methods

-Close
-getShortAddress
-Open
-Read
-Write:
-WriteAsync:

Close


-(void) Close; 
Discussion

断开连接 Disconnect


getShortAddress


-(NSString *) getShortAddress; 
Discussion

用于获取从蓝牙广播得到的地址,wifi得到的是ip地址 To get the address from the bluetooth broadcast, the wifi gets the IP address.


Open


-(void) Open; 
Discussion

连接打印机 Connect the printer


Read


-(void) Read; 
Discussion

从打印机读取数据(暂无用) Read data from the printer (useless)


Write:


-(void) Write:(NSData *)data; 
Discussion

发送数据到打印机 Send data to the printer


WriteAsync:


-(void) WriteAsync:(NSData *)data; 
Parameters
data

要发送的数据

Discussion

发送数据到打印机,异步执行 Send data to printer, execute asynchronously


Properties

Address
blewritetype
IsOpen
Name
Port
printerCmdtype
Timeout

Address


@property (nonatomic,
    copy) NSString * Address; 
Discussion

连接地址 Connection address


blewritetype


@property (nonatomic) BleWriteType blewritetype; 
Discussion

蓝牙写入方式 Bluetooth write mode


IsOpen


@property (nonatomic,
    readonly) BOOL IsOpen; 
Discussion

是否已经连接上打印机 Whether the printer has been connected to the printer


Name


@property (nonatomic,
    copy) NSString * Name; 
Discussion

设备逻辑名称 用于蓝牙名称 The device logical name is used for Bluetooth name


Port


@property (nonatomic) NSInteger Port; 
Discussion

连接端口(仅限wifiInterface使用) Connection port (only for wifiInterface use)


printerCmdtype


@property (nonatomic) PrinterCmdType printerCmdtype; 
Discussion

指令类型, sdk内部没用到,为了给外部多连接时使用 Instruction type, sdk internal useless, in order to use the external multi-connection


Timeout


@property (nonatomic) NSTimeInterval Timeout; 
Discussion

连接超时的时间,单位:秒(仅限wifiInterface使用) Connection timeout, unit: second (wifiInterface only)